home *** CD-ROM | disk | FTP | other *** search
/ MediaClips: Full Bloom / Aris MediaClips - Full Bloom.iso / mac / Full Bloom™ / Full Bloom™ / card_4937.txt < prev    next >
Text File  |  1993-05-18  |  10KB  |  257 lines

  1. -- card: 4937 from stack: in
  2. -- bmap block id: 2287
  3. -- flags: 0000
  4. -- background id: 2786
  5. -- name: First Card
  6. ----- HyperTalk script -----
  7. on wsFindHit
  8.   global findMe, searchHits, numHit, ifFind, hitPath, windowName, allFound, lastFindMe
  9.   global searchMe, howFarDown, aFoundLine, startChar, startSelect, endSelect
  10.   get i2_Text of window "Find"
  11.   if it Γëá findMe then
  12.     put Scrunch(i2_Text of window "Find") into findMe
  13.     put 1 into startChar
  14.     put empty into aFoundLine
  15.     put empty into searchHits
  16.     put 0 into numHit
  17.     get "i3_Name:Find" & return & "i7_Text:0" & return & "i8_Text:" & return & "i9_Text:"
  18.     set properties of window "Find" to it
  19.     set i0_Height of window "Find" to "288"
  20.   else
  21.     set i0_Height of window "Find" to "288"
  22.   end if
  23.   if findMe Γëá empty then
  24.     put TRUE into ifFind
  25.     arisFind findMe -- compiles data to be searched
  26.     if findMe Γëá lastFindMe then
  27.       put FALSE into allFound
  28.     end if
  29.     if allFound Γëá TRUE then
  30.       set i12_Visible of window "Find" to TRUE
  31.       repeat
  32.         set cursor to busy
  33.  
  34.         if the mouseClick then
  35.           set i3_Name of window "Find" to "Continue"
  36.           set i8_Text of window "Find" to searchHits
  37.           set i12_Visible of window "Find" to FALSE
  38.           exit repeat
  39.         end if
  40.         findInXCMD searchMe,findMe,startChar,FALSE
  41.         put the result into xTract
  42.         put item 1 of xTract & "," after aFoundLine
  43.         put item 5 of xTract into startChar
  44.         if item 1 of xTract = 0 then
  45.           beep
  46.           set i3_Name of window "Find" to "Find"
  47.           set i8_Text of window "Find" to searchHits
  48.           put TRUE into allFound
  49.           put findMe into lastFindMe
  50.           exit repeat
  51.         end if
  52.         put char 1 to 80 of line item 1 of xTract of searchMe & return after searchHits
  53.         put numHit + 1 into numHit
  54.         set i7_Text of window "Find" to numHit
  55.       end repeat
  56.     else beep
  57.   end if
  58. end wsFindHit
  59. on findPICTname x
  60.   global hitPath, startChar, howFarDown, aFoundLine, lineNo, searchMe
  61.   put locateF() & "data:aris.data" into fileName
  62.   open file fileName
  63.   read from file fileName until "Γëê"
  64.   close file fileName
  65.   repeat with i = 1 to the number of lines in it
  66.     put word 1 of line i of it into item i of xTractor
  67.   end repeat
  68.   put item howFarDown of aFoundLine into lineNo
  69.   get line lineNo of searchMe
  70.   repeat with i = 1 to the number of items in xTractor
  71.     if it contains (item i of xTractor) then
  72.       put line lineNo - i + 1 to lineNo - i + 5 of searchMe into hitPath
  73.       exit repeat
  74.     end if
  75.   end repeat
  76. end findPICTname
  77. on startUsingStack theStack
  78.   -- make sure the stack can be 'used'
  79.   if theStack is in the stacksInUse then exit startUsingStack
  80.   if the number of lines in the stacksInUse = 10
  81.   then stop using stack (line 1 of the stacksInUse)
  82.   if there is a stack theStack then
  83.     start using stack theStack
  84.     get the result
  85.     if it is not empty then
  86.       if it is "Can't start using home." then exit startUsingStack -- Γêå
  87.       answer it
  88.       exit to hyperCard
  89.     end if
  90.   end if
  91. end startUsingStack
  92. on stopUsingStack theStack
  93.   if theStack is in the stacksInUse
  94.   then stop using stack theStack
  95. end stopUsingStack
  96. on BuildSndList
  97.   global sndKind,thePath,sndList,theSnd,List2,lastPath,windowName,lastSnd,theDialog,numberOfSnds
  98.   global setSound,sKind,sndListWithIcons
  99.   put locateF() & "snd Files:" into thePath
  100.   if sndList = empty or thePath Γëá lastPath then
  101.     put locateF() & "data:sndData" into fileName
  102.     if IsFile(filename) then
  103.       open file filename
  104.       read from file filename until empty
  105.       close file filename
  106.       put it into sndList
  107.     else
  108.       put GetDir(thePath,"F","o=nr") into sndList
  109.       repeat with i = 1 to the number of lines of sndList
  110.         put "," before line i of sndList -- Add item that normally would contain the snd Type
  111.       end repeat
  112.       put ChangeStr(sndList,"[44]",",","all") into sndList -- Change "[44]'s" back into commas
  113.     end if
  114.     put the number of lines of sndList into numberOfSnds
  115.     if setSound = empty or thePath Γëá lastPath then
  116.       put empty into setSound
  117.       put empty into sKind
  118.       put empty into sndListWithIcons
  119.       repeat with i = 2 to 101
  120.         set cursor to busy
  121.         set numberformat to "0.#" -- circle
  122.         if (i-1) Γëñ numberOfSnds then
  123.           put item 1 of line (i-1) of sndList into x
  124.           if x is not in sKind then
  125.             put x into line (number of lines of sKind + 1) of sKind
  126.           end if
  127.           findInXCMD sKind,x,1,FALSE
  128.           put (item 1 of the result) * 1000 into sndKind
  129.           put sndKind + round(((last item of line (i-1) of sndList/1024)/22)/2.5) & return after setSound
  130.           put sndKind + round(((last item of line (i-1) of sndList/1024)/22)/2.5) && item 2 to number of items of line (i-1) of sndList -1 of line (i-1) of sndList & return after sndListWithIcons
  131.         end if
  132.       end repeat
  133.     end if
  134.     put thePath into lastPath
  135.   end if
  136.   set i1_Text of window "Sound Picker" to setSound
  137.   get"i5_Text:" & (line 1 of sKind) & return & "i7_Text:" & (line 2 of sKind) & return & "i9_Text:" & (line 3 of sKind) & return & "i11_Text:" & (line 4 of sKind) & return & "i13_Text:" & (line 5 of sKind)
  138.   set the properties of window "Sound Picker" to it
  139. end BuildSndList
  140. on playTheSound
  141.   global lastSnd,theSnd,myRefNum,sndKind,sndLength,paletteName,numberOfSnds,pList,start_ticks
  142.   put locateF() & "Snd Files:" & theSnd into sndfileName
  143.   put "" into lastSnd
  144.   set i21_Name of window "Sound Picker" to "Stop"
  145.   if paletteName contains "Sm" then
  146.     set i6_Name of window paletteName to sound
  147.   else set i7_Name of window paletteName to sound
  148.   set i22_text of window "Sound Picker" to "ΓÇ╣Click the mouse to stop"
  149.   put char 1 of i1_SelectionText of window "Sound Picker" & "000" into sndKind
  150.   set cursor to 4
  151.   put "" into start_ticks
  152.   playItAgainSoundm sndfileName,theSnd
  153.   set i21_Name of window "Sound Picker" to "Play"
  154.   set i22_text of window "Sound Picker" to "Γé¼Double-Click to play sound"
  155.   set i19_Text of window "Sound Picker" to sndLength
  156.   set numberformat to "0.#"
  157.   if i1_Style of window "Sound Picker" = ListWithIcons then
  158.     set i1_textOfSelection of window "Sound Picker" to sndKind + round(sndLength/2.5) && theSnd
  159.   else
  160.     set i1_textOfSelection of window "Sound Picker" to sndKind + round(sndLength/2.5)
  161.   end if
  162.   if paletteName contains "Sm" then
  163.     set i6_Name of window paletteName to nosound
  164.   else set i7_Name of window paletteName to nosound
  165. end playTheSound
  166. on wsAnimate
  167.   global start_ticks,theSnd,sndKind,sndLength,ifSlideShow,stopShow
  168.   if ifSlideShow then
  169.     if the mouseClick then
  170.       put TRUE into stopShow
  171.       exit to hypercard
  172.       exit wsAnimate
  173.     end if
  174.   else if there is a window "Sound Picker" then
  175.     if start_ticks="" then put the ticks into start_ticks
  176.     if ((the ticks - start_ticks)/60) Γëñ sndLength then
  177.       put round(((the ticks - start_ticks)/60)/2.5 + sndKind) into i
  178.       set numberformat to "0.#"
  179.       get i1_SelectionText of window "Sound Picker"
  180.       if i1_Style of window "Sound Picker" = ListOfIcons then
  181.         if it Γëá i then
  182.           set i1_textofselection of window "Sound Picker" to i
  183.         end if
  184.       else
  185.         if word 1 of it Γëá i then
  186.           set i1_textofselection of window "Sound Picker" to i && theSnd
  187.         end if
  188.       end if
  189.       set i19_text of window "Sound Picker" to ((the ticks - start_ticks)/60)
  190.     else
  191.       put "done" into the sound
  192.       exit wsAnimate
  193.     end if
  194.   end if
  195. end wsAnimate
  196. on showPrefs
  197.   global pSize,ifBackground,ifSound,ifInfo,FullStyle,SmallStyle,ThumbStyle,defaultSize,pStyle,ifXL
  198.   global bgColor,theData
  199.   if item 3 of screenInfo(Main) > 640 then put FALSE into hideBIGSCREEN
  200.   else put TRUE into hideBIGSCREEN
  201.   if pSize = " (small)" then
  202.     put "Small" into defaultSize
  203.     put SmallStyle into pStyle
  204.   else if pSize = " Thumbnails" then
  205.     put "Thumbnails" into defaultSize
  206.     put ThumbStyle into pStyle
  207.   else
  208.     put "Full Size" into defaultSize
  209.     put FullStyle into pStyle
  210.   end if
  211.   get "i1_Hilite:" & ifBackground & return & "i2_Hilite:" & ifSound & return & "i3_Hilite:" & ifInfo & return & "i5_SelectionText:" & defaultSize & return & "i7_SelectionText:" & FullStyle & return & "i9_SelectionText:" & SmallStyle & return & "i11_SelectionText:" & ThumbStyle & return & "i19_Text:," & bgColor & return & "i19_WhiteColor:" & bgColor & return & "i23_Disabled:" & hideBIGSCREEN & return & "i23_Hilite:" & ifXL
  212.   put windowScript("Preferences" & return & it) into prefData
  213.   if prefData Γëá empty then
  214.     put line 1 of prefData into ifBackground
  215.     put line 2 of prefData into ifSound
  216.     put line 3 of prefData into ifInfo
  217.     put line 5 of prefData into defaultSize
  218.     put line 7 of prefData into FullStyle
  219.     put line 9 of prefData into SmallStyle
  220.     put line 11 of prefData into ThumbStyle
  221.     put line 19 of prefData into bgColor
  222.     put line 23 of prefData into ifXL
  223.     if line 19 of prefData = "" then put 256 into bgColor
  224.     if defaultSize = "Small" then
  225.       put " (small)" into pSize
  226.       put SmallStyle into pStyle
  227.     else if defaultSize = "Thumbnails" then
  228.       put " Thumbnails" into pSize
  229.       put ThumbStyle into pStyle
  230.     else
  231.       put empty into pSize
  232.       put FullStyle into pStyle
  233.     end if
  234.     put "Background=" & ifBackground & "Γëê" into line 1 of theData
  235.     put "Sound=" & ifSound & "Γëê" into line 2 of theData
  236.     put "Info=" & ifInfo & "Γëê" into line 3 of theData
  237.     put "Size=" & pSize & "Γëê" into line 4 of theData
  238.     put "Style=" & pStyle & "Γëê" into line 5 of theData
  239.     put "FullStyle=" & FullStyle & "Γëê" into line 6 of theData
  240.     put "SmallStyle=" & SmallStyle & "Γëê" into line 7 of theData
  241.     put "ThumbStyle=" & ThumbStyle & "Γëê" into line 8 of theData
  242.     put "bgColor=" & bgColor & "Γëê" into line 9 of theData
  243.     put "ifXL=" & ifXL & "Γëê" into line 10 of theData
  244.     writePrefs
  245.     -- set visible of cd window to ifBackground
  246.     if ifBackGround = TRUE then
  247.       if there is a window "Blackout" then show window "Blackout"
  248.       else get windowScript("Blackout")
  249.       send "Sendtoback" to window "Blackout"
  250.       wsSet "Blackout",0,WhiteColor,bgColor
  251.     else
  252.       if there is a window "Blackout" then close window "Blackout"
  253.     end if
  254.     showPicture
  255.   end if
  256. end showPrefs
  257.